# 计算最大公约数
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

# 计算最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)

m, n = map(int, input().split())

gcd_res = gcd(m, n)
lcm_res = lcm(m, n)

print(f"{gcd_res} {lcm_res}")